//
//  ShopCommentCell.m
//  OrderSeat
//
//  Created by wangwei on 13-10-7.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

#import "ShopCommentCell.h"

@interface ShopCommentCell ()

@end

@implementation ShopCommentCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void)setContent:(NSDictionary*)dic
{
    _usernameLabel.text = [dic objectForKey:@"huiyuan"];
    _timeLabel.text = [dic objectForKey:@"add_time"];
    _totalPointLabel.text = [[dic objectForKey:@"pingfen"] stringValue];
    _servicePointLabel.text = [[dic objectForKey:@"fuwu"] stringValue];
    _tastePointLabel.text = [[dic objectForKey:@"kouwei"] stringValue];
    _envPointLabel.text = [[dic objectForKey:@"huanjing"] stringValue];
    _priceLabel.text = [[dic objectForKey:@"xiaofei"] stringValue];
    _commentLabel.text = [dic objectForKey:@"pingyu"];
    
    [self reLayoutSubviews];
}

- (void)reLayoutSubviews
{
    [_usernameLabel autoWidthForSingleLine];
    [_timeLabel autoWidthForSingleLine];
    _timeLabel.left = _usernameLabel.right_10;
    
    [_commentLabel autoHeightForMutiLines];
    
    self.height = _commentLabel.bottom_5;
}

- (CGFloat)getCellHeight:(NSDictionary*)dic
{
    [self setContent:dic];
    return self.height;
}

@end
